The technology described herein relates to a method and apparatus for processing graphics, and in particular to a method and apparatus for use when processing graphics primitives in a tile-based graphics processing system.
As is known in the art, graphics processing is normally carried out by dividing the graphics processing output to be generated into a number of similar basic components or “primitives”, which are then subjected to the desired graphics processing operations. The graphics “primitives” are usually in the form of simple polygons, such as triangles.
The primitives for an output such as a frame to be displayed are usually generated by the applications program interface for the graphics processing system, using the graphics drawing instructions (requests) received from the application (e.g. game) that requires the graphics processing.
Each primitive is at this stage usually defined by and represented as a set of vertices. Each vertex for a primitive has associated with it a set of data (such as position, colour, normal, texture coordinate and other attributes data) representing the vertex. (This data is then used, e.g., when rasterising and rendering the primitive to which the vertex relates, e.g. for display.)
Once primitives (and their vertices) have been generated and defined, they can be processed by the graphics processing system, in order, e.g. to render the desired graphic processing output, such as a frame for display.
It is known in graphics processing systems to use so-called “tile-based” rendering. In tile based rendering, the, e.g., two dimensional, output array or frame of the rendering process (the “render target”) (e.g., and typically, that will be displayed to display a scene that is being rendered) is sub-divided or partitioned into a plurality of smaller sub-regions, usually referred to as “tiles”, for the rendering process. The tiles (sub-regions) are each rendered separately (typically one after another). The rendered tiles (sub-regions) are then recombined to provide the complete output array (frame) (render target), e.g. for display.
The tiles can therefore be thought of as the sub divisions of the render target area (output frame) that the rendering process operates on. In such arrangements, the render target area (output frame) is typically divided into regularly sized and shaped tiles (they are usually, e.g., squares or rectangles) but this is not essential.
Other terms that are commonly used for “tiling” and “tile-based” rendering include “chunking” (the sub-regions are referred to as “chunks”) and “bucket” rendering. The terms “tile” and “tiling” will be used herein for convenience, but it should be understood that these terms are intended to encompass all alternative and equivalent terms and techniques.
It is now known to provide tile-based graphics processing systems that include multiple independent graphics processors/processing cores. This offers the opportunity to render plural tiles in parallel, thereby potentially reducing the time taken to render an output frame. Typically, in these systems, any one processor will render more than one tile of any particular output frame.
In tile-based rendering, before any given tile of an output frame is rendered, it is typically first determined which tiles of the output frame each and every primitive that is to be processed (potentially) falls within (at least partially). Typically this determination is made using the positions of the vertices of each primitive. Depending on its size, a primitive may fall within just one tile of an output array, or, alternatively, a primitive may fall within multiple tiles of an output array.
As part of this process, a list is produced for each and every tile (and/or for sets of plural tiles) of the render output, e.g. frame, in question, indicating which primitives should be processed for the tile(s) to which the list relates. Each such list typically contains data (e.g. vertex data, as discussed above), commands, etc., for each primitive appearing in the tile(s) to which the list corresponds. The tile list is then read by the graphics processor allocated to the corresponding tile when that tile is to be processed. As noted above, the same primitive may fall within multiple tiles, and so the data for the same primitive may appear in multiple tile lists (corresponding to multiple tiles).
When processing a particular primitive in a tile list, the graphics processor will typically calculate primitive-specific data for the primitive before that primitive processed (rasterised and rendered). This primitive-specific data will typically include (line) equations representing each of the edges of the primitive, which are derived (e.g. using the primitive vertex data) in order to test which sampling points within a tile are covered by that particular primitive during the rasterisation process. This primitive-specific data may also include, for example, depth equations, barycentric interpolation equations, etc.